With the development of image processing technology, data processing of more lifelike 3D images have gradually become a hotspot. As important technology in 3D image data processing, 3D image data compression includes vertex connection data compression and vertex data compression. With an existing method for vertex connection data compression, it is possible to achieve an efficiency in vertex connection data compression approaching a theoretical limit. A method for compressing vertex data in 3D image data has therefore become an efficiency-determining factor in 3D image data compression.
An existing method for compressing vertex data includes steps as follows. A compression codebook is generated; a residual vector of each vertex in 3D image data to be compressed is calculated and taken as a residual vector to be encoded; a preset compression codebook is searched for a codeword of optimal match of each residual vector to be encoded, and an index of the found codeword of optimal match is taken as compressed data of the vertex; compressed data of any remaining vertex are obtained by repeating the search step for a codeword of optimal match of the residual vector of the vertex.
A method for generating a compression codebook includes steps as follows. 3D image data for generating a compression codebook are selected; a residual vector of each vertex in the selected 3D image data is calculated using a parallelogram prediction algorithm; the compression codebook is obtained as a set of codewords resulted from training a modulus of the residual vector of each vertex data using an LBG algorithm. However, this method fails to taken into full consideration characteristics in distribution of moduli of residual vectors in 3D image data, namely, the fact that there are more residual vectors having small moduli with minimal difference between each other. A compression codebook generated as such therefore includes large amounts of codewords with very small Euclidean distances, thereby leading to waste of storage space. For example, assuming that a compression codebook finally obtained is formed by one hundred codewords {x1,y1,z1; x2,y2,z2; . . . ; x100,y100,z100}, eighty of which have residual vectors with moduli range from 0 to 150, with very small Euclidean distances among the eighty compression codes; therefore more storage space will be used to store a lot of similar codewords. Moreover, as only a small part of the compression codebook is used to represent vertex data with residual vectors of large moduli, image quality cannot be improved.
In addition, in the aforementioned method for compressing vertex data, a compression codebook is searched with a Full Search (FS) method by: traversing all codewords in the compression codebook to calculate the Euclidean distance between each codeword and a residual vector to be encoded; taking a codeword with a minimal Euclidean distance to the residual vector as a codeword of optimal match of the residual vector; and taking an index of the codeword of optimal match as compressed data of the vertex. However, as a preset compression codebook includes a lot of codewords with small Euclidean distances between each other, a lot of time will be spent traversing a lot of similar codewords and calculating similar Euclidean distances, thus affecting efficiency in compressing the vertex data. Moreover, the large number of similar codewords will lead to an increased number of codeword indices and therefore to an increased number of bits for codeword indices, such that a compression ratio of the vertex data (a bit ratio of compressed data of the vertex to the residual vector of the vertex) cannot be improved.
It can be seen that without fully utilizing characteristics in distribution of vertex data in 3D image data, the existing method for compressing vertex data fails to save codeword storage space, enhance encoding quality and improve a compression ratio of vertex data, thereby affecting a compression efficiency.